package com.sinosoft.tcmneim.controller;

import com.sinosoft.tcmneim.dataObject.TblStatus;
import com.sinosoft.tcmneim.service.TblStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 *
 *搜索紧急医学救援基地管理Controller
 * @author 马晨豪
 * @date 2021-09-15
 */
@RestController
@RequestMapping("/status")
public class TblStatusController {
    @Autowired
    TblStatusService tblStatusService;

    /**
     * 根据页面搜索紧急医学救援基地管理
     * @param creationtime
     * @param province
     * @param name
     * @return
     */
    @GetMapping(value = "/bfAll")
    public List<TblStatus> TblStatusAll(String creationtime,
                               String province,
                               String name
                              ) {
            List<TblStatus> list = tblStatusService.getTblStatusAll(creationtime,province,name);

          return list;

    }

    /**
     * 修改紧急医学救援基地管理
     */
    @PostMapping("/update")
    public int updateStu(TblStatus status){
        return tblStatusService.updateStatus(status);
    }

    /**
     * 删除紧急医学救援基地管理
     */
    @PostMapping( "/delete")
    public int deleteStatus(String itemCode)
    {
        return tblStatusService.deleteByItemCode(itemCode);
    }


}
